#!/bin/bash
#
# Security-less security provider: implements no security whatsoever. Generates
# timestamps as signatures. The purpose of this provider is to support closed
# environment configurations (e.g. compute clusters) where communication is
# handled via shared filesystems, and security is implemented at the system
# level (i.e. only authorized users can change the Pulley subscription).
#
# Author:   Dr. Mike Murphy (mmurphy2@coastal.edu)
# Revision: 18 November 2013
#
#   Copyright 2013 Coastal Carolina University
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#


# Does not implement import_key, export_key, or generate_key


## psec_none_verify_signature <path> <signature file> <target file>
##
## Ignores its arguments and does nothing, implementing no security
## whatsoever. Returns 0.
##
function psec_none_verify_signature() {
	return 0
}


## psec_none_sign <path> <output file> <input file> [options]
##
## Implements the no-security provider by simply writing a timestamp to the
## <output file>. Ignores the remaining arguments. Returns 0 if successful,
## non-zero if an error occurs.
##
function psec_none_sign() {
	t_timestamp > "$2"
	return $?
}
